package com.xuxueli.applyModules.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 本科生绩点
 */
@Mapper
public interface TableIdxMapper {

    /**
     * 获取表索引
     * @return
     */
    @Select("<script>select count(1) from information_schema.statistics where table_name = #{table} and index_name = #{idxName} "
            + "</script>")
    int getTableIdxByTable(@Param(value = "idxName") String idxName, @Param(value = "table") String table);

    /**
     * 创建表索引
     * @return
     */
    @Select("CREATE index ${idxName} on ${table} (${col})")
    void createIdx(@Param(value = "idxName") String idxName, @Param(value = "table") String table, @Param(value = "col") String col);


}

